feat(autoresearch): reduce bash output token spend#3763
Closed
MattPua wants to merge 1 commit into
Closed
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
MattPua
force-pushed
the
posthog-code/autoresearch-bash-token-spend
branch
7 times, most recently
from
July 23, 2026 16:38
0ca6637 to
ebf991d
Compare
Generated-By: PostHog Code Task-Id: 272f46f4-223e-41c5-8bd3-681e5d96028f
MattPua
force-pushed
the
posthog-code/autoresearch-bash-token-spend
branch
from
July 23, 2026 16:44
ebf991d to
6961434
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Results
The measured saving comes from a representative noisy pnpm test fixture. Runtime validation also covered npm and Python test execution.
Created with Autoresearch.
Problem
Test output can spend substantial agent context on repetitive passing lines, hiding the failure or summary that matters.
The safety contract is strict:
flowchart LR A[Original command] --> B{Verified test form?} B -->|No| C[Run unchanged] B -->|Yes| D{Compatible RTK?} D -->|No| C D -->|Yes| E[Filter repetitive test output] E --> F[Preserve summary, failure, and exit code]Methodology
Only test ecosystems exercised locally are eligible:
flowchart TD C[Candidate command] --> S{Single bare command?} S -->|No| RAW[Run unchanged] S -->|Yes| T{Supported test form?} T -->|No| RAW T -->|Yes| M{Machine-readable flags?} M -->|Yes| RAW M -->|No| R{Executable RTK 0.43.0+?} R -->|No| RAW R -->|Yes| O[Use RTK test filtering]Changes
No PostHog-specific runtime commands or package names are included.
Verification
The research benchmark was run locally and is intentionally excluded from this PR.
Areas to watch
Automatic notifications
Created with PostHog Code